import React, { useState } from 'react'
import { FuncComp, TestClassComp } from './components'

const App = () => {
  const [flag , setFlag] = useState(true)
  const [message, setMessage] = useState('123')
  
  return (
    <div>
      {/* { flag &&  <TestClassComp message="今天天气还不错"></TestClassComp> }
      <button onClick={ () => setFlag(!flag) }>切换</button> */}
      <hr />
      <button onClick={() => setFlag(!flag)}>1123</button>
      { flag && <FuncComp message={ message }></FuncComp> }
    </div>
  )
}


export default App